from django.db import models

# Create your models here.


class Area(models.Model):
    name = models.CharField(verbose_name='区域', max_length=20)
    parent = models.ForeignKey('self', verbose_name='上级区域',
                               null=True, blank=True, related_name='subs',
                               on_delete=models.SET_NULL)

    class Meta:
        db_table = 'tb_areas'

    def __str__(self):
        return self.name

